package com.cloud.logger.zchain.core.common.entity.builder;

import com.cloud.logger.zchain.core.common.entity.AngelaLoggerProject;

import java.util.Date;

/**
 * 卓锐科技有限公司
 * Created by wmm on 2017/5/18.
 * email：6492178@gmail.com
 * description:
 *
 * @author wmm
 */

public final class AngelaLoggerProjectBuilder {
    private Long id;
    //父节点（如果是根节点为0）
    private String parentNode;
    private String name;
    private String code;
    private Date createTime;
    private String updateTime;
    private String ip;
    private String path;
    private Date startTime;
    private Date shutDownTime;

    private AngelaLoggerProjectBuilder() {
    }

    public static AngelaLoggerProjectBuilder anAngelaLoggerProject() {
        return new AngelaLoggerProjectBuilder();
    }

    public AngelaLoggerProjectBuilder withId(Long id) {
        this.id = id;
        return this;
    }

    public AngelaLoggerProjectBuilder withParentNode(String parentNode) {
        this.parentNode = parentNode;
        return this;
    }

    public AngelaLoggerProjectBuilder withName(String name) {
        this.name = name;
        return this;
    }

    public AngelaLoggerProjectBuilder withCode(String code) {
        this.code = code;
        return this;
    }

    public AngelaLoggerProjectBuilder withCreateTime(Date createTime) {
        this.createTime = createTime;
        return this;
    }

    public AngelaLoggerProjectBuilder withUpdateTime(String updateTime) {
        this.updateTime = updateTime;
        return this;
    }

    public AngelaLoggerProjectBuilder withIp(String ip) {
        this.ip = ip;
        return this;
    }

    public AngelaLoggerProjectBuilder withPath(String path) {
        this.path = path;
        return this;
    }

    public AngelaLoggerProjectBuilder withStartTime(Date startTime) {
        this.startTime = startTime;
        return this;
    }

    public AngelaLoggerProjectBuilder withShutDownTime(Date shutDownTime) {
        this.shutDownTime = shutDownTime;
        return this;
    }

    public AngelaLoggerProject build() {
        AngelaLoggerProject angelaLoggerProject = new AngelaLoggerProject();
        angelaLoggerProject.setId(id);
        angelaLoggerProject.setParentNode(parentNode);
        angelaLoggerProject.setName(name);
        angelaLoggerProject.setCode(code);
        angelaLoggerProject.setCreatedDate(createTime);
//        angelaLoggerProject.set(updateTime);
        angelaLoggerProject.setIp(ip);
        angelaLoggerProject.setPath(path);
        angelaLoggerProject.setStartTime(startTime);
        angelaLoggerProject.setShutDownTime(shutDownTime);
        return angelaLoggerProject;
    }
}
